Operators

Generic operators

class qtealeaves.operators.TNOperators(set_names='default', mapping_func=None)[source]

Generic class to write operators. This class contains no pre-defined operators. It allows you to start from scratch if no other operator class fulfills your needs.

Arguments

set_nameslist of str, optional

Name of the operators sets. Default to default

mapping_funccallable (or None), optional

Mapping the site index to an operator. Arguments site_idx must be accepted. Default to None (default mapping to only operator set)

check_alternative_op(set_name, key)[source]

Check entry for alternative operators, i.e., the sigma_x squared is the identity.

Arguments

set_namestr

Search in this set name of operators. (Set names allow different Hilbert spaces on different sites.)

keystr

Operator represented as key. Check if there is an alternative key for this key.

Returns

alternative_keyNone | str

If None, no alternative key is given or the corresponding dictionary for checking is not set. If str, then this operator has the same representation as key.

generate_products_2nd_order(left_conj=False, left_transpose=False, right_conj=False, right_transpose=False)[source]

Generate all possible multiplications (matrix-matrix multiplications) of the operator set, i.e., [A, B, …] generators [A*A, A*B, B*A, B*B, …]. Transformation can be taken into account on top.

Arguments

left_conjBoolean

Tells if the left operator needs to be complex conjugated. Default is False.

right_transposeBoolean

Tells if the left operator needs to be transposed. Default is False.

right_conjBoolean

Tells if the right operator needs to be complex conjugated. Default is False.

right_transposeBoolean

Tells if the right operator needs to be transposed. Default is False.

Returns

None (in-place update of the operator dictionary)

Extract the local links from the operators.

Arguments

num_sitesinteger

Number of sites.

paramsdict

Dictionary with parameterization of the simulation.

get_operator(site_idx_1d, operator_name, params)[source]

Provide a method to return any operator, either defined via a callable or directly as a matrix.

Arguments

site_idx_1dint, str

If int, site where we need the operator. Mapping will evaluate what to return. If str, name of operator set.

operator_namestr

Tag/identifier of the operator.

paramsdict

Simulation parameters as a dictionary; dict is passed to callable.

items()[source]

Iterate throught all (key, value) pairs of all operators sets.

property mapping_func

Mapping function for site to operator set name.

property one_unique

Flag if only one operators set exists (True) or multiple (False).

property set_names

Return operator set names as list of strings.

transform(transformation, **kwargs)[source]

Generate a new TNOperators by transforming the current instance.

Arguments

transformationcallable

Accepting key and value as arguments plus potential keyword arguments.

**kwargskey-word arguments

Will be passed to transformation

Spin 1/2 operators

class qtealeaves.operators.TNSpin12Operators[source]

Operators specifically targeted at spin 1/2 systems. The operators id, sx, sz, n``= 1/2*(1-``sz), and nz = 1/2*(1+``sz``) are provided by default.

Arguments

folder_operatorsstr, optional

The name of the subfolder inside the input folder, where we store operators. Default to SPIN12

Qudit operators

class qtealeaves.operators.TN3levelsOperators[source]

Operators defined for Lambda-like three-level systems, e.g., used in the case of Rydberg systems.

Arguments

folder_operatorsstr, optional

The name of the subfolder inside the input folder, where we store operators. Default to 3levels

Details

The three levels are labeled as: |0>, |1> and |r>. The following operators are defined: n0, n1, nr, sx01, sy01, sz01, n01, n10, n1r, nr1, sx1r. The identity id is defined as well.

class qtealeaves.operators.TN4levelsOperators[source]

Operators defined for a 4-level system, e.g., targeting Rydberg systems with two low-energy states, one Rydberg state |r>, and one additional state |d> allowing a decay from |r> to |d>.

Arguments

folder_operatorsstr, optional

The name of the subfolder inside the input folder, where we store operators. Default to 4levels

Details

The following operators are defined: n0, n1, nr, nd, sx01, and sx1r. The identity id is defined as well.

Bosonic operators

class qtealeaves.operators.TNBosonicOperators[source]

Operators specifically targeted at bosonic systems. The operators id, b, bdagger, n, and nint are provided by default.

Details

The truncation of the Fock-space can be set via the keys fock_space_nmin and fock_space_nmax. By default, the local dimension is four including the levels 0, 1, 2, and 3.

static get_b(params)[source]

Define the bosonic annihilation operator.

static get_bdagger(params)[source]

Define the bosonic creation operator.

static get_id(params)[source]

Define the identity operator.

static get_n(params)[source]

Define the number operator.

static get_nint(params)[source]

Define the on-site interaction operator 0.5 * n * (n - 1).

Combined operators

class qtealeaves.operators.TNCombinedOperators(ops_a, ops_b)[source]

Combine operators for system a and b.

Arguments

ops_ainstance of TNOperators

Set of operators for system a.

ops_binstance of TNOperators

Set of operators for system b.

folder_operatorsstr, optional

The name of the subfolder inside the input folder, where we store operators. Default to CombinedOps

Details

The key of the operators after merging will be ops_a.ops_b.

get_any_operator_function(key_a, key_b)[source]

Get function to compute kronecker product between set of operators a and b.

Parameters

key_astr

Operator name of class a.

key_bstr

Operator name of class b.

merge_ops()[source]

Merge set of operators.